package self.zhangkang.android.network

import android.content.Context
import android.net.ConnectivityManager
import android.os.Build

/**
 * Created on 2019/10/10
 * Title:
 * Description:
 *
 * @author Android-张康
 */
object NetworkStatusHelper {


    fun whetherTheNetworkIsConnected(context: Context): Boolean {
        val connectivityManager =
            context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager

        return connectivityManager.activeNetworkInfo?.isAvailable == true
    }
}